//
//  HistoryMatchTableViewCell.swift
//  FootballDataRecord
//
//  Created by Xx Jiang on 2020/1/9.
//  Copyright © 2020 Xx Jiang. All rights reserved.
//

import UIKit

class HistoryMatchTableViewCell: UITableViewCell {

    @IBOutlet weak var teamALogo: UIImageView!
    @IBOutlet weak var teamBLogo: UIImageView!
    @IBOutlet weak var teamAName: UILabel!
    @IBOutlet weak var teamBName: UILabel!
    @IBOutlet weak var time: UILabel!
    
    @IBOutlet weak var score: UILabel!
    
    @IBOutlet weak var bgview: UIView!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.bgview.layer.shadowColor = #colorLiteral(red: 0.08235294118, green: 0.08235294118, blue: 0.08235294118, alpha: 1)
        self.bgview.layer.shadowOffset = CGSize.init(width: 0.0, height: 3.0)
        self.bgview.layer.shadowOpacity = 1.0
        self.bgview.layer.shadowRadius = 10.0
        self.bgview.layer.cornerRadius = 5

    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        
    }
    func setcell(model:MatchModel) {

        let teamAmodel = TeamModel.getTeamModelWithTeamID(teamId: model.matchTeamA!)
        let teamBmodel = TeamModel.getTeamModelWithTeamID(teamId: model.matchTeamB!)
        teamALogo.image = getImage(path: teamAmodel.teamHead ?? "")
        teamBLogo.image = getImage(path: teamBmodel.teamHead ?? "")
        teamAName.text = teamAmodel.teamName
        teamBName.text = teamBmodel.teamName
        time.text = model.matchTime
        score.text = "\(model.matchScoreA ?? "0")   -   \(model.matchScoreB ?? "0")"
        
        //一个球队的比赛数据
//        MatchDataModel.getMatchDataModelWithID(matchDataID: (teamAmodel.teamMatchDataId!)) { (result) in
//
//            
//            
//        }
        
        
        //获取球员球员
//        PlayerModel.getPlayerModelWithPlayerID(playerId: <#T##String#>, CompeleteBlock: <#T##compeletBlock##compeletBlock##(AnyObject) -> ()#>)
        
        //一个球员的比赛数据
//        MatchDataModel.getMatchDataModelWithID(matchDataID: model.teamAModel., CompeleteBlock: <#T##compeletBlock##compeletBlock##(AnyObject) -> ()#>)
        
        
        
    }
}
